package com.gitee.wsl.data.input.viewmodel.undo


import com.gitee.wsl.coroutines.Queued
import com.gitee.wsl.data.input.interceptor.BallastInterceptorScope
import kotlinx.coroutines.CoroutineScope

class UndoScopeImpl<Inputs : Any, Events : Any, State : Any>(
    private val interceptorScope: BallastInterceptorScope<Inputs, Events, State>
) : UndoScope<Inputs, Events, State>, CoroutineScope by interceptorScope {
    override suspend fun restoreState(state: State) {
        interceptorScope.sendToQueue(Queued.RestoreState(null, state))
    }
}
